<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
	  xmlns:th="http://www.thymeleaf.org"
	  xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity4">
<head>
	<meta charset="utf-8"/>
	<title>系统中心登录</title>
	<meta name="renderer" content="webkit"/>
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
	<meta name="apple-mobile-web-app-status-bar-style" content="black"/>
	<meta name="apple-mobile-web-app-capable" content="yes"/>
	<meta name="format-detection" content="telephone=no"/>
	<!--<link rel="icon" th:href="@{/images/favicon.ico}">-->
	<link rel="stylesheet" th:href="@{/js/layui-v2.4.5/layui/css/layui.css}" media="all" />
	<link rel="stylesheet" th:href="@{/css/public.css}" media="all" />
</head>
<body onload="loadTopWindow()" class="loginBody">
<form class="layui-form" th:action="@{/login}" method="post" >
	<div class="login_face"><img th:src="@{/images/face.jpg}" class="userAvatar"></div>
	<div class="layui-form-item input-item">
		<label for="userName">用户名</label>
		<input type="text" placeholder="请输入用户名" autocomplete="off" name="username" id = "username"  class="layui-input" lay-verify="required">
	</div>
	<div class="layui-form-item input-item">
		<label for="password">密码</label>
		<input type="password" placeholder="请输入密码" autocomplete="off" name="password"  id = "password" class="layui-input" lay-verify="required"  >
	</div>
	<div class="layui-form-item input-item" id="imgCode">
		<label for="code">验证码</label>
		<input type="text" placeholder="请输入验证码" autocomplete="off" name="validateCode"  id ="validateCode" class="layui-input">
		<img th:src="@{/captcha/getCaptcha}" width="116" height="36" id="chche" onclick="refresh()">
	</div>
	<div class="layui-form-item">
		<button class="layui-btn layui-block" lay-filter="login" id="login" lay-submit>登录</button>
	</div>
	<!--<div class="layui-form-item layui-row">-->
		<!--<a href="javascript:;" class="seraph icon-qq layui-col-xs4 layui-col-sm4 layui-col-md4 layui-col-lg4"></a>-->
		<!--<a href="javascript:;" class="seraph icon-wechat layui-col-xs4 layui-col-sm4 layui-col-md4 layui-col-lg4"></a>-->
		<!--<a href="javascript:;" class="seraph icon-sina layui-col-xs4 layui-col-sm4 layui-col-md4 layui-col-lg4"></a>-->
	<!--</div>-->
</form>
<!--在body的写上onload事件要调用的方法-->
<script th:src="@{/js/layui-v2.4.5/layui/layui.js}"></script>
<script th:src="@{/js/jquery-1.7.2.min.js}"></script>

<script>
    function loadTopWindow(){


        if (window != top){
            console.log("window != top")
            window.top.location.href=document.URL;
		}
//        if(window.top.location!=self.location) {
//            window.top.location.href=document.URL;
//        }
    }

    //刷新验证码
    function refresh() {
        document.getElementById("chche").src = "/auth/captcha/getCaptcha";

    }

</script>
<script th:inline="javascript">
    var param = [[${param1}]];
	var    layer ;
    layui.use(['form','layer'],function() {

        var form = layui.form;
            layer = layui.layer;
        console.log("错误参数："+param);
        if(param!=""){
            layer.msg(param,{icon: 5})
        }


        //表单输入效果
        $(".loginBody .input-item").click(function(e){
            e.stopPropagation();
            $(this).addClass("layui-input-focus").find(".layui-input").focus();
        })
        $(".loginBody .layui-form-item .layui-input").focus(function(){
            $(this).parent().addClass("layui-input-focus");
        })
        $(".loginBody .layui-form-item .layui-input").blur(function(){
            $(this).parent().removeClass("layui-input-focus");
            if($(this).val() != ''){
                $(this).parent().addClass("layui-input-active");
            }else{
                $(this).parent().removeClass("layui-input-active");
            }
        })

    });


</script>

</body>
</html>